import request from "@/utils/request"

// 登录
interface loginType {
    tenantName: string
    username: string
    password: string
}

export const login = (data: loginType) => {
    return request({
        url: "/login",
        headers: { isToken: false },
        data: data,
        method: "POST",
    })
}

// 获取用户信息
export const getInfo = async () => {
    return await request({ url: '/getInfo'})
}
// 获取路由信息
export const getRouters = async () => {
    return await request({ url: '/getRouters'})
}


// 登出
export const loginOut = () => {
    return request({ url: '/logout', method: "POST" })
}

// 获取验证码
export const sendCode = (mobile: number | string, scene: number) => {
    return request({ url: '/send-sms-code', method: "POST", data: { mobile, scene } })
}